package com.dd.restcontroller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.dd.dao.UserDao;
import com.dd.model.User;

@RestController
public class UserRestController {
	
	@Autowired
	private UserDao userdao;
	
	@Value("${profile}")
	private String profile;
	
	@GetMapping("/{id}")
	public User findByid(@PathVariable Long id){
		User user = userdao.findOne(id);
		System.out.println("loadbalance 8072");
		return user;
	}
	
	@GetMapping("/profile")
	public String hello(){
		return profile;
	}
	
}
